Skip to content

Conversation

@9184Lucky
Copy link

No description provided.

@github-grap-bot
Copy link

Hi @pilarvargas-tecnativa,
some modules you are maintaining are being modified, check this out!

datetime_start = fields.Datetime.from_string(self.date)
datetime_delta = timedelta(hours=valid_hours)
expiration = fields.Datetime.to_string(datetime_start + datetime_delta)
expiration = datetime_start + datetime_delta

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is better to use the fields tool and remove the datetime import.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @pilarvargas-tecnativa Simplification done but I found not field tools to add an integer do self.date. I saw the add function from date_utils but it does not work if valid_hours is greater than 23. Don't hesitate to suggest any other improvement.
Please not that it is not a OCA PR yet, I will push it to OCA later in the day !

@pilarvargas-tecnativa
Copy link

hughesbm and others added 14 commits June 23, 2025 11:13
* [ADD] website_sale_affiliate: Create module
* Add sale.affiliate and sale.affiliate.request models
* Override WebsiteSale controller shop method to store affiliate
  id & key kwargs of shop urls in session
* Override sale order create method to store affiliate request
* Add affiliate and request views, links in Sales/Affiliates
* Add affiliate_request_id to sale.order form view
* Add request sequence record, make default for new affiliates
* Add access rights to sales users/managers
* Add tests
* Add readme instructions

* [IMP] website_sale_affiliate: Make requested changes
* Update readme
* Add controller override to catch product urls
* Remove redundant return None
* Replace if statements with try/except when appropriate
* Change api decorator on sale.affiliate.find_from_session method
  from model -> model_cr_context
* Add check to avoid unnecessary db search in find_from_session if
  no affiliate_id
* Fix tests
* Add new tests

* [IMP] website_sale_affiliate: Make requested changes
* Un-nest try/except statements for readability
* Rename kwargs: ref, key -> aff_ref, aff_key
* Improve request search speed for large recordsets
* Document similarly-named methods for clarity
* Tweak tests as needed
* Add additional test
* Add roadmap to readme

* [REM] website_sale_affiliate: Remove affiliate request IP-matching

* [IMP] website_sale_affiliate: Change affiliate request creation
* Create affiliate requests regardless of whether a sale occurs
* Add basic conversion/sales stats to affiliate model and views
* Update tests
* Add demo data
* Clean up views
* Remove line used for debugging
* Add field string for clarity

* [FIX] website_sale_affiliate: Fix compatibility issues, tests
* Fix controller method overrides to avoid conflicts
* Match assertAlmostEqual decimal places to amount used in fields
* Remove/replace tests with unneeded url_open calls
* Rename files, variables for clarity
* Clean up demo/test data

* [IMP] website_sale_affiliate: Clarify affiliate request name
* Add help to name field on affiliate request model
* Handle the case of no web session, which will raise a `RuntimeError('object unbound')` when attempting to access it. This happens during XML record creations, but likely other places such as in the shell
Currently translated at 13.7% (7 of 51 strings)

Translation: e-commerce-10.0/e-commerce-10.0-website_sale_affiliate
Translate-URL: https://translation.odoo-community.org/projects/e-commerce-10-0/e-commerce-10-0-website_sale_affiliate/it/
Make direct calls to controller instead of using mock.
Some tests were removed but the tested functionalities will be tested in
their respective test files.
@9184Lucky 9184Lucky changed the title 16.0 mig website sale affiliate [16.0][MIG] website_sale_affiliate: Migration to 16.0 Jun 23, 2025
@9184Lucky 9184Lucky force-pushed the 16.0-mig-website_sale_affiliate branch from a6453a6 to 2f76ead Compare June 23, 2025 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.